#pragma once

#include <MemoryPoolFactory.h>
#include <Singleton.h>
#include <ObjKeyGenerator.h>
using namespace util;

class Object;		class Player;
class Item;			class MapObject;
class Monster;		class Summoned;
class MapNpc;

class ObjectFactory : public Singleton<ObjectFactory>
{
public:
	ObjectFactory();
	~ObjectFactory();

	VOID			Init( DWORD dwPlayerPool, DWORD dwMonsterPool, DWORD dwItemPool,
							DWORD dwMapObjectPool, DWORD dwMapNPCPool );
	VOID			Release();
	Object *		AllocObject( eOBJECT_TYPE eObjecType );
	VOID			FreeObject( Object * pObject );
	VOID			DisplayPoolInfo();
private:
	CMemoryPoolFactory<Player> *		m_pPlayerPool;
	CMemoryPoolFactory<Monster>*		m_pMonsterPool;
	CMemoryPoolFactory<Summoned>*		m_pSummonedPool;
	CMemoryPoolFactory<Item>*			m_pItemPool;
	CMemoryPoolFactory<MapObject>*		m_pMapObjectPool;
	CMemoryPoolFactory<MapNpc>*			m_pMapNPCPool;

	util::CObjKeyGenerator *			m_pMonsterKeyGenerator;
	util::CObjKeyGenerator *			m_pFieldItemKeyGenerator;

};



